1. Field of the Invention
The present invention relates to the field of graphical and non-graphical software controls, and more particularly to a Data Socket client for accessing data from any of various locations and having any of various formats.
2. Description of the Related Art
In modern networked computer systems, the computer system may be required to obtain data from various sources, including local memory on the computer system, external data sources connected to the computer system, such as I/O devices connected to computer system ports, and other networked computer systems, such as computer systems connected to a LAN, WAN or to the Internet. When a program executing on a computer system is required to access data, the program is often required to account for the source or location of the data, opening and closing of files, the format of the data, and conversion of the data to readable formats, among others.
One of the biggest challenges in developing complex applications that are comprised of different components is sharing and exchanging information and data between the different components. Today, this task is solved using a number of different existing tools, including writing and reading files, DDE, ActiveX automation, http server and client tools, and more. In addition, measurement, as well as other engineering applications, often place some special requirements on sharing data, such as providing additional information qualifying the data.
Hence, an improved system and method is desired for providing programs with access to data from various sources and having various types or formats, wherein the access is provided invisibly to the user or programmer.
Background on component software concepts is deemed appropriate. Various object-oriented and component-based software standards have been developed in recent years. For example, Active X Controls, formerly called OLE controls, are software components that conform to a standard defined by Microsoft. In many ways, Active X controls are similar to traditional libraries. However, since the standard is well defined, there are many applications that can use any Active X control simply by providing support for the Active X standard. Applications or programming environments which support Active X controls are commonly referred to as xe2x80x9cActive X Control Containersxe2x80x9d or simply xe2x80x9ccontainersxe2x80x9d. Broadly speaking, a container is a software entity which holds software components. Examples of containers are Microsoft""s xe2x80x9cExcelxe2x80x9d spreadsheet product, xe2x80x9cWordxe2x80x9d word processor, xe2x80x9cAccessxe2x80x9d database product, and the Visual Basic programming environment. The Active X standard affords software application developers the opportunity to develop custom Active X controls to add into and use in their software applications.
Controls are typically objects and/or have object-oriented features. Therefore, each control has its own set of methods, events and properties. A method is a function which acts on or is performed by a particular control. For example, a control may possess a xe2x80x9cmovexe2x80x9d method to move the control around on a display screen. An event is an action recognized by a control, such as clicking a mouse or pressing a key. A control has associated code which executes in response to an event recognized by the control. A property is the control""s data (settings or attributes), such as color, shape or size. The properties of a control may be edited, i.e., changed to create the desired user interface. Controls may have custom properties that are specific to the control.
In order to incorporate a control into an application or a container, the control is placed or xe2x80x9cdroppedxe2x80x9d onto a form. The control has associated properties, which are listed in the Properties window. The developer changes the properties by selecting a property field and changing the value. The control reflects the change when the developer enters the change into the Properties window.
The present invention comprises a Data Socket client and associated applications and/or tools which provide programs with access to data from various sources and having various types or formats, wherein the access is provided invisibly to the user. The Data Socket client, also referred to as DataSocket, allows the user or program to access any data source available on the user""s machine as well as data anywhere on a network, such as a LAN, WAN or the Internet.
In the preferred embodiment, the Data Socket client addresses data sources or I/O sources using a URL (uniform resource locator), much the way that a URL is used to address web pages anywhere in the world. The present invention also includes new Data Socket URLs which allow the user to access I/O sources. When reading from an input source, the Data Socket performs all work necessary to read the raw data from various input sources and to parse the data and return it in a form directly usable by the user""s applications. When writing to an output target the Data Socket performs all work necessary to format the data provided by the user into the appropriate raw format for the specific target.
The Data Socket client is preferably a Data Socket control or other type of re-useable software component. The Data Socket client includes a simple set of properties which provides ease of use. The Data Socket client includes a property referred to as URL which is used to specify the data source. The Data Socket client also includes a status property which informs the program using the Data Socket client as to the state of the connection, i.e., whether the socket is unconnected or connected.
In addition to properties, the Data Socket client includes a simple set of events. The primary event is referred to as xe2x80x9cDataUpdatedxe2x80x9d The DataUpdated event is fired whenever the source to which the Data Socket client is connected has a new value to be used by the application program. The Data Socket client also includes an event referred to as xe2x80x9cStatusUpdatedxe2x80x9d, which is fired whenever the status of the connection changes. This makes it easy for the client or the application using the Data Socket client to monitor this state and to provide information on the state at a very high level to the end user.
In order to use the Data Socket client, the user places the Data Socket client into a program and preferably configures a URL input mechanism, such as a URL text box. The user or programmer enters a URL into the URL text box associated with the Data Socket client. The URL can also be a standard Internet URL, such as http, ftp, file etc. As an example, the URL can begin with xe2x80x9cfile:xe2x80x9d, signifying that a data file is the source of data. The remainder of the URL comprises a path that is meaningful to the machine where the data file resides. This includes files on the local machine or files addressable within the Internet that are accessible by the local machine. Thus the Data Socket client allows a program to address data or files locally, or from a server, or from a peripheral device.
Once the URL is provided, the Data Socket client examines the URL and determines if the Data Socket control can process the data. If so, the Data Socket client retrieves the data. During the data retrieval, the Data Socket client handles opening and closing of the file. The Data Socket client also converts the data to a format useable by the application. In the preferred embodiment, the Data Socket client obtains the data and converts it to a format referred to as a Flex Data object. Once the data has been received and converted, the Data Socket client generates an event to the application program, and the application can receive and process the data.
If the Data Socket client cannot recognize the raw data format, the Data Socket client preferably attempts to find a Data Socket extension or plug-in that can convert the raw data to data usable by the application using the Data Socket. The Data Socket client preferably identifies these extensions by the file suffix, or the mime type associated with the raw data stream. If the data socket client finds an extension that can convert the data from the raw binary contents of the file to data that is directly usable by the program, the Data Socket client creates an instance of the determined extension, and the extension instance retrieves the data and converts the data to a format useable by the application.
The Data Socket can be extended by the user to connect to new or custom I/O devices by creating a Data Socket extension or plug-in. The extension is identified by the access method that a URL begins with. As an example, the industry standard API called OPC (OLE for Process Control), which is used to communicate with hardware PLC devices, can be directly accessed using the simple Data Socket component accesses. If the URL begins with xe2x80x9copc:xe2x80x9d and opc is not a URL type for which the Data Socket has built-in support, then the Data Socket will attempt to find an OPC Data Socket extension component that can connect to an OPC I/O device. The specific Data Socket extension parses the remaining part of the URL. The Data Socket extension also determines from the URL how it should use OPC to connect to a specific PLC.
The present invention also includes a new data format referred to as Flex Data or FlexData, as mentioned above. Flex Data is the format of the underlying data packet that Data Socket tools use to send and store information. Flex Data data packets are system independent and can be transferred over existing communication technologies such as ActiveX Automation/COM or TCP/IP. The data packet has provisions for adding standard and user defined named attributes that are used to further describe the information contained in the packet. Information such as a time stamp, test operator name, Unit-Under-Test (UUT) identifier, and more can be added to the data being transferred. Data Socket clients convert data native to an environment and its attributes into Flex Data format or convert Flex Data back into its native data form. The Flex Data packet is self-describing so no additional information must be exchanged between a client and its source or target.
The present invention also includes a program referred to as a Data Socket server which operates to automatically redistribute data to other Data Sockets. The user""s application directs the Data Socket client to connect to a Data Socket server by using a URL that begins with the access mode xe2x80x9cdstp:xe2x80x9d To use the Data Socket server, the Data Socket client writes data to the Data Socket server, which then automatically redistributes the data to other Data Sockets. For the Data Socket client this operation is no different than writing to a file. For the Data Sockets that receive the redistributed data, this operation is similar to reading data from other sources like ftp, http(web), or file servers. The primary difference is that, for the Data Sockets that receive the redistributed data, the event xe2x80x9cDataUpdatedxe2x80x9d is called whenever the first Data Socket writes a new value to the Data Socket server and the new value is redistributed. This allows the receiving Data Sockets to return a continuous stream of data to the user""s application instead of just a single value.
The Data Socket client thus provides a new technology and tools that greatly simplify sharing data, such as engineering and scientific data, between different applications or application components. The Data Socket client provides improved sharing of data between components running on the same computer or between different computers on a network.